﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Prj1012m.aspx.cs" Inherits="Updms.Prj.Prj1012m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Prj1012m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Prj1012m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">	
				<tr>
					<td class="lbl"><asp:Literal id="ltr_search_prj_id" Text="프로젝트" runat="server" /></td>
					<td class="ctl" colspan="5"><asp:dropdownlist id="ddl_search_prj_id" runat="server" CssClass="ddl" Width="99.9%"></asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_div" Text="구분" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_div" runat="server" CssClass="ddl"></asp:dropdownlist></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_title" Text="제목" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_title" runat="server" Width="98%" CssClass="ib_b"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_send_yn" Text="전송여부" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_send_yn" runat="server" CssClass="ddl"></asp:dropdownlist></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 페이지모드 전환버튼 시작 -->
			<div class="page_mode_area">
				<span id="btn_chg_mode" onclick="return chgMode()" runat="server"></span>
				<span id="btn_init_mode" title="초기화" class="sbtn sbtn_init" onclick="return initDetail()"></span>
			</div>
			<!-- 페이지모드 전환버튼 끝 -->
			<!-- 디테일1 시작 -->
			<table id="table_detail_1" class="table_detail" runat="server">
				<tr>
					<td class="lbl"><asp:Literal id="ltr_div" Text="구분" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_div" runat="server" CssClass="ddl"></asp:dropdownlist></td>
					<td class="lbl"><asp:Literal id="ltr_title" Text="제목" runat="server" /></td>
					<td class="ctl" colspan="3"><asp:textbox id="txt_title" runat="server" Width="99.2%" CssClass="ib_b req"></asp:textbox></td>					
				</tr>
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_report_dt" Text="보고일" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_report_dt" runat="server" CssClass="ib_b_dt req"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_report_dt" class="ci_calendar" runat="server"></td>
					<td class="lbl" width="11%"><asp:LinkButton id="lbtn_create_dt" runat="server" ToolTip="보고일계산" Font-Underline="True" OnClientClick="return chkCreateDt()" OnClick="lbtn_create_dt_Click"><asp:Literal id="ltr_start_dt" Text="보고시작일" runat="server" /></asp:LinkButton></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_start_dt" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_start_dt" class="ci_calendar" runat="server"></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_end_dt" Text="보고종료일" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_end_dt" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_end_dt" class="ci_calendar" runat="server"></td>
				</tr>
				<tr>
					<td class="ctl" colspan="6" style="padding:1px">
						<table class="default">
							<tr>
								<td class="lbl_c" width="50%"><asp:Literal id="ltr_results" Text="실적" runat="server" /></td>
								<td class="lbl_c" width="50%"><asp:Literal id="ltr_plans" Text="계획" runat="server" /></td>
							</tr>
							<tr>
								<td class="ctl" style="padding:1px"><asp:TextBox id="txt_results" runat="server" Width="98.3%" CssClass="tb_scroll" Height="204px" TextMode="MultiLine" Rows="8"></asp:TextBox></td>
								<td class="ctl" style="padding:1px"><asp:TextBox id="txt_plans" runat="server" Width="98.3%" CssClass="tb_scroll" Height="204px" TextMode="MultiLine" Rows="8"></asp:TextBox></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table id="table_list_set" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<div class="div_right"><asp:checkbox id="cb_list_all" runat="server" AutoPostBack="True" OnCheckedChanged="cb_list_all_CheckedChanged"></asp:checkbox></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq,Prj_Id,Div,Start_Dt,End_Dt,Results,Plans">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Prj_Id" HeaderText="Prj_Id(X)" Visible="False" />
								<asp:BoundField DataField="Div" HeaderText="Div(X)" Visible="False" />
								<asp:BoundField DataField="Div_Nm" HeaderText="구분" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="10%" />
								</asp:BoundField>
								<asp:BoundField DataField="Report_Dt" HeaderText="보고일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Start_Dt" HeaderText="Start_Dt(X)" Visible="False" />
								<asp:BoundField DataField="End_Dt" HeaderText="End_Dt(X)" Visible="False" />
								<asp:TemplateField HeaderText="제목">
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Title") %>'></asp:LinkButton>
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Left" Width="24%" />
									<HeaderStyle CssClass="lbtn_rc" />
								</asp:TemplateField>
								<asp:BoundField DataField="Results" HeaderText="Results(X)" Visible="False" />
								<asp:BoundField DataField="Plans" HeaderText="Plans(X)" Visible="False" />
								<asp:BoundField DataField="Results_Summary" HeaderText="실적" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="20%" />
									<HeaderStyle CssClass="balloon" />
								</asp:BoundField>
								<asp:BoundField DataField="Plans_Summary" HeaderText="계획" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="20%" />
									<HeaderStyle CssClass="balloon" />
								</asp:BoundField>
								<asp:BoundField DataField="Send_Yn" HeaderText="전송여부" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Email" HeaderText="메일전송" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>								
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result Count : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 설명 시작 -->			
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<asp:linkbutton id="lbtn_init_detail" runat="server" OnClick="lbtn_init_detail_Click" />
				<asp:linkbutton id="lbtn_chg_mode" runat="server" OnClick="lbtn_chg_mode_Click" />
				<input id="h_no" type="hidden" name="h_no" runat="server"/>
				<input id="h_row_idx" type="hidden" name="h_row_idx" runat="server"/>
			</div>
			<!-- 히든값 끝 -->
			<!-- CalendarExtender 시작 -->
			<act:CalendarExtender ID="ce_report_dt"
				runat="server"
				TargetControlID="txt_report_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_report_dt"
				EnableViewState="False"
				BehaviorID="bi_report_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<act:CalendarExtender ID="ce_start_dt"
				runat="server"
				TargetControlID="txt_start_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_start_dt"
				EnableViewState="False"
				BehaviorID="bi_start_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<act:CalendarExtender ID="ce_end_dt"
				runat="server"
				TargetControlID="txt_end_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_end_dt"
				EnableViewState="False"
				BehaviorID="bi_end_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<!-- CalendarExtender 끝 -->
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//저장
	function chkSave() {
		if ($F("txt_report_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_017), setFocus, "txt_report_dt");	//보고일을 입력해주세요
			return false;
		}
		if (!isDateHyphen($F("txt_report_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_report_dt"); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		if (!isDateHyphen($F("txt_start_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_start_dt"); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		if (!isDateHyphen($F("txt_end_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_end_dt"); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		if ($F("txt_title").blank()) {
			msgBox.alert(getMsg(MSG_ERR_016), setFocus, "txt_title");	//제목을 입력해주세요
			return false;
		}

		var pk = $get("lbl_pk").innerHTML;
		var MSG_ID = (pk == "") ? MSG_CFM_000 : MSG_CFM_028; //저장/수정
		msgBox.confirm(getMsg(MSG_ID), doSave); //저장하시겠습니까?

		return false;
	}

	//삭제
	function chkDelete() {
		if (!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_001), doDelete);	//삭제하시겠습니까?
		return false;
	}
	
	//보고일 자동계산
	function chkCreateDt() {
		if ($F("txt_report_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_017), setFocus, "txt_report_dt");	//보고일을 입력해주세요
			return false;
		}
		
		//날짜형식
		if(!isDateHyphen($F("txt_report_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_report_dt"); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
	}
		
	//디테일 초기화
	function initDetail() {
		__doPostBack('lbtn_init_detail','');
	}
	
	//페이지모드 변경
	function chgMode() {
		__doPostBack('lbtn_chg_mode','');
	}

</script>
</body>
</html>